{assign var="latestpoll" value=$core->database->latest_poll()}
{if $smarty.get.vote}
{if $core->database->addvote($latestpoll.pollid, $smarty.post.vote) == 1}
Vote added successfully<br />
{else}
Vote failed {php}echo mysql_error();{/php}<br />
{/if}
{/if}
{assign var="poll" value=$core->database->get_poll($latestpoll.pollid)}
{if !$poll}
No active poll {if $core->session->isLoggedIn() == 1}{if $smarty.session.userlevel >= $smarty.const.USER_MODERATOR}- <a href="./?n=polls/create">Create Poll</a>{/if}{/if}
{else}
{$latestpoll.question}<br /><br />
{section name=poll loop=$poll}
{$poll[poll].activity} - {$core->makePercent($poll[poll].votes,$poll.0.sumvotes)}%<br />
<div class="poll_bar"><div class="poll_bar_inner" style="width: {$core->makePercent($poll[poll].votes,$poll.0.sumvotes)}%;">&nbsp;</div></div><br />
{/section}
Total Votes: {$poll.0.sumvotes}
{/if}